package ru.spbsu.electromenu.model;

import ru.spbsu.electromenu.util.collections.Idable;

import java.util.Date;
import java.util.Map;

/**
 * Date: 3/19/11
 * Time: 6:02 PM
 *
 * @author Artem Titov
 */
public class Alert implements Idable {
    private int id = -1;
    private int sessionId = -1;
    private String alertMessage = null;
    private Date time = null;
    private boolean active = false;
    private Session session;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getSessionId() {
        return sessionId;
    }

    public void setSessionId(int sessionId) {
        this.sessionId = sessionId;
    }

    public String getAlertMessage() {
        return alertMessage;
    }

    public void setAlertMessage(String alertMessage) {
        this.alertMessage = alertMessage;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public Session getSession() {
        return session;
    }

    public void injectSession(Map<Integer, Session> sessions) {
        this.session = sessions.get(sessionId);
    }
}
